<template id="checkTeacher">
  <a-modal
    :visible="visible"
    title="学生导师设置"
    :width="700"
    :confirmLoading="confirmLoading"
    @cancel="() => { $emit('close') }"
  >
    <a-row>
      <a-col :md="12" :sm="24" class="item">
        <a-col :md="7" offset="1" style="text-align:right">学号：</a-col>
        <a-col :md="15" offset="1">{{info.xh}}</a-col>
      </a-col>
      <a-col :md="12" :sm="24" class="item">
        <a-col :md="7" offset="1" style="text-align:right">姓名：</a-col>
        <a-col :md="15" offset="1">{{info.xm}}</a-col>
      </a-col>
    </a-row>
    <a-row>
      <a-col :md="12" :sm="24" class="item">
        <a-col :md="7" offset="1" style="text-align:right">院系：</a-col>
        <a-col :md="15" offset="1">{{ info.ssyxmc}}</a-col>
      </a-col>
      <a-col :md="12" :sm="24" class="item">
        <a-col :md="7" offset="1" style="text-align:right">专业：</a-col>
        <a-col :md="15" offset="1">{{ info.sszymc}}</a-col>
      </a-col>
    </a-row>
    <a-row>
      <a-col :md="12" :sm="24" class="item">
        <a-col :md="7" offset="1" style="text-align:right">年级：</a-col>
        <a-col :md="15" offset="1">{{ info.sznj}}</a-col>
      </a-col>
    </a-row>
    <a-row>
      <a-col :md="12" :sm="24" class="item">
        <a-col :md="7" offset="1" style="text-align:right">调换前第一导师姓名：</a-col>
        <a-col :md="15" offset="1">{{ info.thqdydsxm}}</a-col>
      </a-col>
      <a-col :md="12" :sm="24" class="item">
        <a-col :md="7" offset="1" style="text-align:right">调换后第一导师姓名：</a-col>
        <a-col :md="15" offset="1">{{ info.thhdydsxm}}</a-col>
      </a-col>
    </a-row>
    <a-row>
      <a-col :md="12" :sm="24" class="item">
        <a-col :md="7" offset="1" style="text-align:right">调换前第二导师姓名：</a-col>
        <a-col :md="15" offset="1">{{ info.thqdedsxm}}</a-col>
      </a-col>
      <a-col :md="12" :sm="24" class="item">
        <a-col :md="7" offset="1" style="text-align:right">调换后第二导师姓名：</a-col>
        <a-col :md="15" offset="1">{{ info.thhdedsxm}}</a-col>
      </a-col>
    </a-row>
    <a-row>
      <a-col :md="12" :sm="24" class="item">
        <a-col :md="7" offset="1" style="text-align:right">调换前研究方向名称：</a-col>
        <a-col :md="15" offset="1">{{ info.thqyjfxmc}}</a-col>
      </a-col>
      <a-col :md="12" :sm="24" class="item">
        <a-col :md="7" offset="1" style="text-align:right">调换后研究方向名称：</a-col>
        <a-col :md="15" offset="1">{{ info.thhyjfxmc}}</a-col>
      </a-col>
    </a-row>
    <a-row v-if="info.shzt!='01'">
      <a-col :md="12" :sm="24" class="item">
        <a-col :md="7" offset="1" style="text-align:right">审核状态：</a-col>
        <a-col :md="15" offset="1">{{ info.shztmc}}</a-col>
      </a-col>
      <a-col :md="12" :sm="24" class="item">
        <a-col :md="7" offset="1" style="text-align:right">审核备注：</a-col>
        <a-col :md="15" offset="1">{{ info.shsm}}</a-col>
      </a-col>
    </a-row>
    <a-form :form="form" v-if="info.shzt=='01'">
      <a-row>
        <a-form-item
          label="审核结果"
          style="width:150px;"
        >
          <a-select style="width:150px;" v-decorator="[
            'shzt',
            {
              initialValue: '02',
              rules: [{ required: true, message: '请选择审核状态!' }],
            }
          ]">
            <a-select-option value="02">审核通过</a-select-option>
            <a-select-option value="03">审核不通过</a-select-option>
          </a-select>
        </a-form-item>
      </a-row>
      <a-form-item label="审核备注">
        <a-input type="textarea" style="width:100%;" v-decorator="['shsm']" :autosize="{ minRows: 2, maxRows: 10 }"/>
      </a-form-item>
    </a-form>
  </a-modal>
</template>
<script>
  export default {
    props: ['visible', 'info'],
    data() {
      return {
        confirmLoading: false,
      }
    },
    created() {
    },
    beforeCreate() {
      this.form = this.$form.createForm(this)

    },
    methods: {
      audit() {
        this.confirmLoading = true;
        this.form.validateFields((err, values) => {
          if (err) {
            return
          }
          let param = Object.assign(values, {id: this.info.id})
          this.$api.student.auditChangeTutor(param).then(res => {
            this.$message.success('操作成功')
            this.$emit('close')
            this.$emit('refresh')

          })
          this.confirmLoading = false;
        })
      },
    }
  }
</script>
<style lang="less">
  .card-area {
    .item {
      line-height: 40px;
      height: 40px;
    }

    #setTeacher {
      .ant-form-item-label {
        text-align: left;
      }
    }
  }
</style>
